<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <css file="__PUBLIC__/css/base.css"/>
            <link type="text/css" href="__ROOT__/data/ui/css/flick/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-1.8.0.min.js"></script>
            <script type="text/javascript" src="__ROOT__/data/ui/js/jquery-ui-1.8.23.custom.min.js"></script>
            <script src="__DATA__/validate.min.js" language="javascript"></script>
			<script type="text/javascript">
                $(function(){
                    $("#tabs").tabs();
                })
            </script>
    </head>
    <body>
        <div class="now_path">
            <strong>您现在的位置：</strong>
            <a href="#">文章管理</a><span>></span>
            <a href="__WEB__/admin/news/news_modify">修改文章</a>
        </div>
		<div class="success_box">所有的选项都填写正确</div>
    	<div class="error_box"></div>
        <div id="tabs" style="width:100%">
            <ul>
                <li><a href="#tabs-1">修改文章</a></li>
				<li><a href="#tabs-2">自定义字段</a></li>
            </ul> 
			<form action="__CONTROL__/news_modify_exe/nid/{$news_info.id}" method="post" name='news'>
            <div id="tabs-1">
                    <table class="table2">
                        <tr>
                            <th>标题：</th>
                            <td><input type="text" name="title" style="width:360px;" value='{$news_info.title}'/></td>
                        </tr>
                        <empty value="$hd.get.catid">
                            <tr>
                                <th>发表栏目：</th>
                                <td><select name="catid">
                                        <option value="">选择栏目</option>
                                        <list from="$category" name="$v">
                                        	<if value='$news_info.catid eq $v.catid'>
                                            	<option value="{$v.catid}" selected='selected'>{$v.html}└─{$v.cname}</option>
											<else />
												<option value="{$v.catid}">{$v.html}└─{$v.cname}</option>
											</if>
                                        </list>
                                    </select></td>
                            </tr>
                        </empty>
                        <tr>
                            <th>来源：</th>
                            <td><input type="text" name="bigbody[source]" style="width:200px;" value='{$news_info.source}'/>
                                <select>
                                    <option value="">===选择来源===</option>
                                </select></td>
                        </tr>
                        <tr>
                            <th>缩略图：</th>
                            <td><upload name="thumb"/></td>
                        </tr>
                        <tr>
                            <th>跳转url：</th>
                            <td><input type="text" name="gourl" style="width:260px;" value='{$news_info.gourl}'/></td>
                        </tr>
                        <tr>
                            <th>关键字：</th>
                            <td><input type="text" name="keywords" style="width:300px;" value='{$news_info.keywords}'/></td>
                        </tr>
                        <tr>
                            <th>描述：</th>
                            <td><textarea style="height:60px;width:90%" name="description">{$news_info.description}</textarea></td>
                        </tr>
						<tr>
                            <th>文章属性：</th>
                            <td>
                            	<foreach from='$attrs' value='$v'>
                            			<?php  if(in_array($v['aid'],$result_attr) && $_GET['mid'] == $news_info_['mid']){ ?>
                            				<input type='checkbox' name='attrrelation[][aid]' value='{$v.aid}' checked='checked'/>&nbsp;{$v.aname}
										<?php }else{ ?>
											<input type='checkbox' name='attrrelation[][aid]' value='{$v.aid}'/>&nbsp;{$v.aname}
										<?php } ?>
								</foreach>
                            </td>
                        </tr>
                        <tr>
                            <th>正文：</th>
                            <td><editor name="bigbody[body]" content='{$news_info.body}'/></td>
                        </tr>
                        
						<tr>
                            <th>文章状态：</th>
                            <td>
                            	<if value='$news_info.status'>
                            	<input type='radio' name='publicno' value='1' checked='checked'/>审核
								<input type='radio' name='publicno' value='0'/>待审
								<else />
								<input type='radio' name='publicno' value='1' />审核
								<input type='radio' name='publicno' value='0' checked='checked'/>待审
								</if>
                            </td>
                        </tr>
                        <tr>
                            <th>点击率：</th>
                            <td><input type="text" name="click" style="width:100px;" value="{$news_info.click}"/></td>
                        </tr>
						<tr>
                       		<th>内容页模板：</th>
                       		<td><input type="text" name="bigbody[template]" style="width:300px;" value='{$news_info.template}'/></td>
                    	</tr>
                    </table>
            </div>
			<div id="tabs-2">
				<table class='table2'>
					<field>
                        <tr>  
                            <th>{$news_info.title}：</th>
                            <td>{$news_info.html}<span class="desc">{$news_info.description}</span></td>
                        </tr> 
                    </field>
				</table>
			</div>
			<input type='hidden' name='catid' value='{$news_info.catid}' />
			<input type='hidden' name='nid' value='{$news_info.id}' />
			<input type='hidden' name='mid' value='{$hd.get.mid}' />
			<input type="submit" class="submit" value="修改文章" name='submit'/>
			</form>
        </div>
				<script type='text/javascript'>
		var SELECTOR_ERRORS = document.getElementById('error_box');
		var validator = new FormValidator('news', [{
		    name: 'title',
		    display: '文章标题',    
		    rules: 'required'
		},{
    		name: 'catid',
			display: '发表栏目',
    		rules: 'required'
		}], function(errors, event) {
		    var SELECTOR_ERRORS = $('.error_box'),
		        SELECTOR_SUCCESS = $('.success_box');
		        
			    if (errors.length > 0) {
			        SELECTOR_ERRORS.empty();
			        
			        for (var i = 0, errorLength = errors.length; i < errorLength; i++) {
			            SELECTOR_ERRORS.append(errors[i].message + '<br />');
			        }
			        
			        SELECTOR_SUCCESS.css({ display: 'none' });
			        SELECTOR_ERRORS.fadeIn(200);
					return false;
			    } else {
			        SELECTOR_ERRORS.css({ display: 'none' });
			        SELECTOR_SUCCESS.fadeIn(200);
					return true;
			    }
		});
	</script>
    </body>
</html>
